package com.ys.erp.stage_user_service.bean.condition;

import com.ys.erp.entity.data.bean.UserCatRecord;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.util.List;

/**
 * @author 南山
 * @date 2025/07/05 16:51
 */
@Data
@Schema(description = "用户猫咪相关请求对象")
public class UserCatCondition {

    @Schema(description = "添加纸质猫咪合同请求对象")
    @Data
    public static class UserCatContractAddCon {

        @Schema(description = "合同类型")
        private String contractType;

        @Schema(description = "签约时间")
        private String signTime;

        @Schema(description = "文件地址")
        private String fileUrl;


    }

    @Data
    @Schema(description = "添加用户猫咪请求对象")
    public static class AddUserCatCon {

        @ApiModelProperty("用户id")
        @NotNull
        private Long userId;

        @ApiModelProperty("猫咪id")
        @NotNull
        private Long catId;

        @ApiModelProperty("是否预定")
        @NotNull
        @Max(1)
        @Min(0)
        private Integer isPre;

        @ApiModelProperty("预定原因")
        @Max(1)
        @Min(0)
        private Integer preReason;

        @ApiModelProperty("预计领走时间")
        @Pattern(regexp = "\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}", message = "时间格式错误")
        private String preDateTime;

        @Pattern(regexp = "\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}")
        private String takeDate;

        @ApiModelProperty("店铺id")
        @NotNull(message = "店铺id不能为空")
        private String shopCode;

        @ApiModelProperty("履约方式, 0,芝麻分分期，1购买，2全款充值")
        @Min(0)
        @Max(3)
        private Integer contractType;

        @ApiModelProperty("履约手机号")
        private String maintainPhone;

        @ApiModelProperty("期数")
        private Integer catPeriod;

        @ApiModelProperty("每期金额")
        private String periodMoney;

        @ApiModelProperty("是否员工领走")
        @Min(0)
        @Max(1)
        private Integer isEmpTake;

        @ApiModelProperty("员工领走id")
        private Long takeEmpId;

        @ApiModelProperty("预定金额")
        private String predictMoney;

        @ApiModelProperty("直接购买备注")
        private String buyRemark;

        @ApiModelProperty("全款金额")
        private String fullMoney;

        @ApiModelProperty("渠道对接人")
        @NotNull(message = "渠道对接人不能为空")
        private List<Long> channelEmpIds;

        @ApiModelProperty("渠道来源")
        private String channelSourceType;

        @ApiModelProperty("是否签订合同")
        @Max(1)
        @Min(0)
        @NotNull
        private Integer isSignContract;

        @ApiModelProperty("签订合同类型，0线上，1线下")
        private Integer signContractType;

        @ApiModelProperty("开单导购人员")
        private Long guideEmpId;

        @ApiModelProperty("签订合同人员")
        private Long signEmpId;

        @ApiModelProperty("检查员工id")
        private Long checkEmpId;

        @ApiModelProperty("备注")
        private String remark;

        @ApiModelProperty("签约方式")
        private Integer contractSignWayType;

        @ApiModelProperty("是否有收款0否1是")
        @NotNull
        @Max(1)
        @Min(0)
        private Integer isHaveInMoney;

        @ApiModelProperty("收款日期")
        @Pattern(regexp = "\\d{4}-\\d{2}-\\d{2}", message = "时间格式错误")
        private String inMoneyDate;

        @NotNull
        @Valid
        @ApiModelProperty("收款明细")
        private List<CatRecordDetailCon> inMoneyDetail;

        @ApiModelProperty("合同")
        private List<Long> contractInfoIds;

        @ApiModelProperty("签约门店编号")
        private String signShop;

        @ApiModelProperty("养护服务费")
        private String conserveServiceFee;
    }


    @ApiModel("猫咪订单业务操作收入明细")
    public static class CatRecordDetailCon extends UserCatRecord.CatRecordDetailDTO {

    }
}
